<?php

  $noSeasonChange = true;
  include_once("includes/header.php");
  $newsItems = array();
  $rs = executeQuery("select date_format(news_date, '%b %e %Y'), news_type, news from news order by news_date desc LIMIT 0, 6");
  while($row = mysql_fetch_row($rs)) {
    array_push($newsItems, $row);
  }
echo <<< EOQ
      <tr>
        <td>
          <center><h1>Edinboro Castle Blood Bowl League</h1></center><br /><br />
          <p><b>Who:</b> Blood Bowl League in North London
          <p><b>Where:</b> <a href="http://maps.google.com.au/maps?f=q&source=s_q&hl=en&geocode=&q=Mason+Arms,+58+Devonshire+Street,+London+W1W+5EA&ie=UTF8&ll=51.522162,-0.144346&spn=0.009573,0.01929&z=16" target="_blank">Mason Arms, 58 Devonshire Street, London W1W 5EA</a>
          <p><b>When:</b> Tuesday nights from 6:30pm<br />
          <p>The ECBBL is the leading London Blood Bowl League
EOQ;
$ad = new ApprovalDao();
if ($ad->hasApprovals()) {
    echo<<< EOQ
        <h4>Match Approvals</h4>
EOQ;
    $myApprovals = $ad->findOutstandingCoachApprovals();
    $commApprovals = $ad->findOutstandingCommissionerApprovals();
    foreach ($myApprovals as $approval) {
        $match = $matches->getMatch($approval->matchId);
        $desc = $match->getDescription();
    echo<<< EOQ
        <a href="match_view.php?matchId=$approval->matchId">$desc</a><br />
EOQ;
    }
    if (count($commApprovals) > 0) {
        echo<<< EOQ
        <h4>Commissioner approvals</h4>
EOQ;
        foreach ($commApprovals as $approval) {
            $match = $matches->getMatch($approval->matchId);
            $desc = $match->getDescription();
    echo<<< EOQ
        <a href="match_view.php?matchId=$approval->matchId">$desc</a><br />
EOQ;
        }
    }
}
echo <<< EOQ
          <h4>Latest Results</h4>
EOQ;
  echoNewsMatch($teams, $races);
  foreach($newsItems as $item) {
echo <<< EOQ
          <h4>$item[0]</h4>
          <b>$item[1]</b>&nbsp;$item[2]
EOQ;
  }
echo <<< EOQ
        </td>
      </tr>
EOQ;
  include("includes/footer.php");
?>
